package com.vito.oa.act.extend.service.impl;

import static com.vito.oa.act.constant.OaActContants.CACHE_ACT_VALUE;
import static com.vito.oa.act.extend.model.OaTaskModel.CACHE_KEY;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;

import com.alibaba.dubbo.config.annotation.Service;
import com.vito.act.service.impl.ActivitiWaitMatterServiceImpl;
import com.vito.base.model.DataGrid;
import com.vito.oa.act.extend.dao.OaActivitiWaitMatterMapper;
import com.vito.oa.act.extend.model.OaTaskModel;
import com.vito.oa.act.extend.service.OaActivitiWaitMatterService;

@Service
public class OaActivitiWaitMatterServiceImpl extends ActivitiWaitMatterServiceImpl
		implements OaActivitiWaitMatterService {

	@Autowired
	private OaActivitiWaitMatterMapper waitMatterMapper;

	@Override
	@Cacheable(value = CACHE_ACT_VALUE, key = CACHE_KEY)
	public DataGrid<Map<String, String>> queryOaWaitDoneByPage(OaTaskModel task) {
		DataGrid<Map<String, String>> dg = new DataGrid<Map<String, String>>();
		dg.setRows(waitMatterMapper.queryWaitDoneByPage(task));
		dg.setTotal(task.getTotal());
		return dg;
	}

	@Override
	public Integer queryWaitDoneByPageCount(OaTaskModel task) {
		return waitMatterMapper.queryWaitDoneByPageCount(task);
	}

}
